<?php
include_once("./function.php");
//print_r($_GET);Array ( [pc_ifshow] => show [pc_id] => 1 )

if(isset($_GET['pc_ifshow']))
{
	extract($_GET);//$pc_ifshow $pc_id
	//$pc_ifshow=trim($pc_ifshow);
	//$pc_id=trim($pc_id);
	if($pc_ifshow=="show")
	{
		$sql="update ts_product_cate set pc_ifshow='noshow' where pc_id=$pc_id";
		$res=mysqli_query($link,$sql);
		if($res)
		{
			if(mysqli_affected_rows($link)>0)
			{
				header("location:./product_cate.php");exit;
			}
		}
	}
	else
	{
		$sql="update ts_product_cate set pc_ifshow='show' where pc_id=$pc_id";
		$res=mysqli_query($link,$sql);
		if($res)
		{
			if(mysqli_affected_rows($link)>0)
			{
				header("location:./product_cate.php");exit;
			}
		}
	}
 
}
?>